// 存储值
export const setUser = (key, value) => {
  if (typeof value === 'object') {
    window.localStorage.setItem(key, JSON.stringify(value))
  }
}
// 获取值
export const getUser = key => {
  const data = window.localStorage.getItem(key)
  try {
    return JSON.parse(data)
  } catch (err) {
    return null
  }
}
// 删除值
export const removeUser = key => {
  window.localStorage.removeItem(key)
}
